package com.huawei.M01.iterator.M25;

/**
 * 2与n的最小公倍数
 *
 * @author zhiwu
 */
public class SmallestEvenMultiple {
    public int smallestEvenMultiple(int n) {
        int value = gcb(2, n);
        return 2 * n / value;
    }

    private int gcb(int a, int b) {
        return b == 0 ? a : gcb(b, a % b);
    }

    public static void main(String[] args) {
        System.out.println(new SmallestEvenMultiple().smallestEvenMultiple(6));
    }
}
